package com.sxjh.controller.temporaryTransport;

import com.sxjh.common.BaseController;
import com.sxjh.common.Result;
import com.sxjh.config.ExcelCacheConfig;
import com.sxjh.entity.ExcelEntity;
import com.sxjh.entity.TrainBookedEntity;
import com.sxjh.entity.param.ScaleReportParam;
import com.sxjh.entity.param.TemporaryTransportParam;
import com.sxjh.entity.param.TrainParam;
import com.sxjh.entity.result.TemporaryTransportResult;
import com.sxjh.service.TemporaryTransportService;
import com.sxjh.uitl.PageUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/temporaryTransport")
@Api(tags = "临时运输报表")
public class TemporaryTransportController extends BaseController {

    @Autowired
    private TemporaryTransportService temporaryTransportService;

    @ApiOperation("火车出入账报表")
    @GetMapping("/getReportInfo")
    Result<List<TemporaryTransportResult>> getReportInfo(TemporaryTransportParam param){
        return Result.ok(temporaryTransportService.selectTemporaryTransport(param));
    }

    @ApiOperation("临时运输报表导出")
    @GetMapping("/temporaryTransportExport")
    Result<String> temporaryTransportExport (@Validated TemporaryTransportParam param) {
        String id = ExcelCacheConfig.setParam(param, ExcelEntity.Type.LSBB);
        return ok(id);
    }


}
